package cloud.maque.admin.service;

import cloud.maque.admin.domain.entity.MqRolePrivilege;
import cloud.maque.admin.domain.request.MenuRoleRequest;
import cloud.maque.admin.domain.request.RoleMenuRequest;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * @author 4color
 * @description mq_role_privilege服务层
 * @date 2023-03-17
 */

public interface MqRolePrivilegeService extends IService<MqRolePrivilege> {

    Boolean deleteByPrivilegeId(String privilegeId);

    Boolean deleteByRoleId(String roleId);

    Boolean deleteByRoleAndMenuId(String roleId, String menuId);


    /**
     * 给菜单添加角色
     *
     * @param menuRoleRequest
     * @return
     */
    void addRoleForMenu(MenuRoleRequest menuRoleRequest);

    /**
     * 给角色添加菜单
     *
     * @param roleMenuRequest
     * @return
     */
    void addMenuForRole(RoleMenuRequest roleMenuRequest);

    /**
     * 单个菜单的权限
     *
     * @param roleId
     * @param menuId
     */
    void addRoleAndMenu(String roleId, String menuId);

    List<String> getMenus(String roleID);

}
